﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._16_责任链模式
{
    /// <summary>
    /// 具体审批人
    /// </summary>
    public class ManagerApprover:Approver
    {
        public override void ProcessRequest(PurchaseRequest request)
        {
            if (request.Amount <= 1000)
            {
                Console.WriteLine($"经理批准了{request.Amount}元的{request.Purpose}采购");
            }
            else if (NextApprover != null)
            {
                NextApprover.ProcessRequest(request);
            }
        }

    }
}
